Skip to content

feat: add flag to exclude networks from using infura for live balance#8992

Merged
jpuri merged 3 commits into
mainfrom
monad_infura_fix
Jun 4, 2026
Merged

feat: add flag to exclude networks from using infura for live balance#8992
jpuri merged 3 commits into
mainfrom
monad_infura_fix

Conversation

@jpuri
Copy link
Copy Markdown
Contributor

@jpuri jpuri commented Jun 3, 2026

Explanation

Add flag to exclude networks from using infura for live balance.
It is needed primarily for Monad, related to PR: #8839

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Changes which RPC endpoint validates live balances before pay quotes/submit; misconfigured flags could cause wrong or failed balance reads on affected chains.

Overview
Adds remote feature flag confirmations_pay_extended.excludeChainIdsFromInfura so specific chains can opt out of preferring Infura for live on-chain balance RPCs (e.g. Monad).

Introduces isChainExcludedFromInfura (case-insensitive chain ID match) and wires getLiveTokenBalance to pass preferInfura: false when the chain is listed, so balance queries use the default network client instead of forcing the Infura endpoint. Behavior is unchanged for chains not in the list.

Unit tests cover the flag helper and Infura skip/use paths in live balance fetching; the package changelog documents the change.

Reviewed by Cursor Bugbot for commit e244127. Bugbot is set up for automated code reviews on this repo. Configure here.

@jpuri jpuri marked this pull request as ready for review June 3, 2026 15:04
@jpuri jpuri requested review from a team as code owners June 3, 2026 15:04
@jpuri jpuri enabled auto-merge June 3, 2026 15:04
@jpuri jpuri added this pull request to the merge queue Jun 4, 2026
Merged via the queue into main with commit 181ee31 Jun 4, 2026
731 of 733 checks passed
@jpuri jpuri deleted the monad_infura_fix branch June 4, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants